<template>
	  <el-table :data="tableData" style="width: 100%">
	    <el-table-column prop="id" label="ID"  />
	    <el-table-column prop="fullName" label="姓名"  />
	    <el-table-column prop="userName" label="用户名" />
	    <el-table-column prop="role" label="角色" >
			<template #default="scope">
				<el-tag v-if="scope.row.role==0">普通用户</el-tag>
				<el-tag v-else>管理员</el-tag>
			</template>
		</el-table-column>
	  </el-table>
</template>

<script>
	import axios from 'axios'
	axios.defaults.baseURL='/api'
	export default{
		data() {
			return{
				tableData:[]
			}
		},
		mounted() {
			axios.get('user').then(response =>{
				this.tableData = response.data
			})
		}
		
	}
</script>

<style>
</style>